package com.shop.service.impl;

import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.shop.bean.Address;
import com.shop.bean.Orders;
import com.shop.bean.Shop;
import com.shop.bean.User;
import com.shop.dao.OrdersDao;
import com.shop.dao.QueryShopDao;
import com.shop.service.OrdersService;
@Service
@Transactional
public class OrdersServiceImpl implements OrdersService {
	@Autowired
	public OrdersDao ordersDao;
	
	public OrdersDao getOrdersDao() {
		return ordersDao;
	}
	public void setOrdersDao(OrdersDao ordersDao) {
		this.ordersDao = ordersDao;
	}
	@Override
	public User selectByUname(String uname) {
		
		return ordersDao.selectByUname(uname);
	}
	@Override
	public Address selectBuUid(Integer uid) {
		
		return ordersDao.selectByUid(uid);
	}
	@Override
	public int addOrders(Orders orders) {
		int n=ordersDao.addOrders(orders);
		return n;
	}
	@Override
	public ArrayList<Orders> selectAll(String uname) {
		
		return ordersDao.selectAll(uname);
	}
	@Override
	public int deleteOrders(Integer integer) {
		int n = ordersDao.deleteOrders(integer);
		return n;
	}
	@Override
	public ArrayList<Orders> selectAllByState(Integer uid) {
		
		return ordersDao.selectAllByState(uid);
	}
	@Override
	public int updateState(Integer gid) {
		int n = ordersDao.updateState(gid);
		return n;
	}
	@Override
	public ArrayList<Orders> queryOrdersBySname(String name) {
		
		return ordersDao.queryOrdersBySname(name);
	}
	@Override
	public int updateStateSeller(Integer gid) {
		int n = ordersDao.updateStateSeller(gid);
		return n;
	}
	
}
